﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Semana02
{
    public partial class main : Form
    {
        public main()
        {
            InitializeComponent();
        }

        private void btnBuscar_Click(object sender, EventArgs e)
        {
            var query = from p in database.TablePRoducto()
                        where p.Descripcion.StartsWith(txtCriterio.Text, true, System.Globalization.CultureInfo.CurrentCulture)
                        select p;

            productoBindingSource.DataSource = query.ToList();   
        }

        private void main_Load(object sender, EventArgs e)
        {
            productoBindingSource.DataSource = database.TablePRoducto();  
        }
    }
}
